package com.carey.blog.framework.latke.servlet;

import java.util.logging.Logger;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletRequestEvent;
import javax.servlet.http.HttpSessionEvent;

import com.carey.blog.framework.latke.Latkes;
import com.carey.blog.framework.latke.RunsOnEnv;

/**
 * Default GAE servlet listener for the application runs on GAE environment.
 * 
 */
public class DefaultGAEServletListener extends AbstractServletListener {

	/**
	 * Logger.
	 */
	private static final Logger LOGGER = Logger
			.getLogger(DefaultGAEServletListener.class.getName());

	@Override
	public void contextInitialized(final ServletContextEvent servletContextEvent) {
		Latkes.setRunsOnEnv(RunsOnEnv.GAE);
		LOGGER.info("Latke is running on Google App Enigne.");

		super.contextInitialized(servletContextEvent);
	}

	@Override
	public void contextDestroyed(final ServletContextEvent servletContextEvent) {
		super.contextDestroyed(servletContextEvent);
	}

	@Override
	public void sessionCreated(final HttpSessionEvent httpSessionEvent) {
	}

	@Override
	public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) {
	}

	@Override
	public void requestInitialized(final ServletRequestEvent servletRequestEvent) {
	}

	@Override
	public void requestDestroyed(final ServletRequestEvent servletRequestEvent) {
	}
}
